/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.features.ruby_string;

import picounit.features.classloader.mutator.DefaultClassMutator;
import picounit.features.ruby_string.delayed.DelayedMethodMutator;

public class RubyStringClassMutator extends DefaultClassMutator {
	public RubyStringClassMutator() {
		super(new RubyStringMethodMutator());
	}

	public static class RubyStringMethodMutator extends DelayedMethodMutator {
		@Override
		public void visitLdcInsn(Object constant) {
			if (!(constant instanceof String)) {
				super.visitLdcInsn(constant);
			}
			else {
				addMethodInstruction(new RubyStringLdcInstruction((String) constant));
			}
		}
	}
}
